Skip to content

Fix GoReleaser configuration for v2 syntax#14

Merged
renecannao merged 1 commit intomasterfrom
phase1/task4-goreleaser
Mar 23, 2026
Merged

Fix GoReleaser configuration for v2 syntax#14
renecannao merged 1 commit intomasterfrom
phase1/task4-goreleaser

Conversation

@renecannao
Copy link
Copy Markdown

Summary

  • Updated .goreleaser.yaml to GoReleaser v2 syntax
  • Added version: 2 declaration
  • Replaced deprecated replacements with name_template in archives
  • Replaced deprecated archives.format_overrides with formats
  • Updated snapshot.name_template to snapshot.version_template
  • Added '^chore:' to changelog exclusion filters

Closes #4

Test plan

  • Verify goreleaser check passes with the new config
  • Verify snapshot build works: goreleaser release --snapshot --skip-publish --clean

Copilot AI review requested due to automatic review settings March 23, 2026 19:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates release tooling/configuration to support GoReleaser v2, while also modernizing the Go module/toolchain and dependency set.

Changes:

  • Migrate .goreleaser.yaml to GoReleaser v2 syntax (add version: 2, update archives/snapshot/changelog filters).
  • Bump go.mod to Go 1.22 and upgrade multiple direct/indirect dependencies (with corresponding go.sum updates).
  • Remove the go1.16 build constraint from downloads/tarball_registry.go.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
.goreleaser.yaml Migrates config to GoReleaser v2 syntax; adjusts archive naming/checksum and snapshot template.
go.mod Raises Go toolchain version to 1.22 and upgrades dependencies.
go.sum Updates module checksums to match the new dependency graph.
downloads/tarball_registry.go Removes legacy build tags (file now builds unconditionally).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread go.mod
module github.com/datacharmer/dbdeployer

go 1.18
go 1.22
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go.mod now declares Go 1.22, but the repository CI workflow still sets up Go ^1.18 (see .github/workflows/all_tests.yml:16-20). This will make CI and local builds inconsistent and can cause CI failures (toolchain may refuse to build a module requiring a newer Go version). Either bump the workflow Go version to >=1.22, or keep the go directive at the CI/tooling-supported version.

Suggested change
go 1.22
go 1.18

Copilot uses AI. Check for mistakes.
Comment thread go.mod
Comment on lines +3 to 20
go 1.22

require (
github.com/alexeyco/simpletable v0.0.0-20180729223640-1fa9009f1080
github.com/araddon/dateparse v0.0.0-20190622164848-0fb0a474d195
github.com/dustin/go-humanize v1.0.0
github.com/go-sql-driver/mysql v1.4.1
github.com/nightlyone/lockfile v0.0.0-20180618180623-0ad87eef1443
github.com/alexeyco/simpletable v1.0.0
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
github.com/dustin/go-humanize v1.0.1
github.com/go-sql-driver/mysql v1.7.1
github.com/nightlyone/lockfile v1.0.0
github.com/pkg/errors v0.9.1
github.com/rogpeppe/go-internal v1.9.0
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.0
github.com/rogpeppe/go-internal v1.12.0
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.6
github.com/stretchr/testify v1.9.0
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
golang.org/x/term v0.13.0
golang.org/x/text v0.13.0
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8
golang.org/x/term v0.25.0
golang.org/x/text v0.19.0
jaytaylor.com/html2text v0.0.0-20200412013138-3577fbdbcff7
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title/description and linked issue focus on updating .goreleaser.yaml for GoReleaser v2, but this change also bumps the module Go version to 1.22 and upgrades multiple dependencies. If this is intentional, it should be called out explicitly (and ideally justified) in the PR description/issue; otherwise consider splitting the Go/toolchain+dependency upgrades into a separate PR to keep the release-config change isolated.

Copilot uses AI. Check for mistakes.
Comment thread .goreleaser.yaml Outdated
Comment on lines +20 to +24
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}

checksum:
name_template: 'checksums.txt'

Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new archive name_template/checksum settings appear incompatible with existing release artifact consumers in this repo. For example scripts/dbdeployer-install.sh downloads dbdeployer-${version}.osx.tar.gz/dbdeployer-${version}.linux.tar.gz and verifies ${filename}.sha256, but this config will produce assets like dbdeployer_<version>_darwin_amd64.tar.gz plus a single checksums.txt. If GoReleaser is becoming the source of release assets, either adjust the templates (and possibly OS naming, e.g. darwin->osx) to preserve the current artifact contract, or update the installer/build tooling to match the new naming + checksum scheme.

Suggested change
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
checksum:
name_template: 'checksums.txt'
{{ .ProjectName }}-{{ .Version }}.{{- if eq .Os "darwin" }}osx{{ else }}{{ .Os }}{{ end }}
checksum:
name_template: '{{ .ArtifactName }}.sha256'
split: true

Copilot uses AI. Check for mistakes.
@renecannao
Copy link
Copy Markdown
Author

@gemini-code-assist review

@renecannao
Copy link
Copy Markdown
Author

@claude review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the GoReleaser configuration to the v2 syntax, which is a necessary maintenance task. The changes correctly replace deprecated fields like replacements and snapshot.name_template with their v2 equivalents. The Go version for the module is also updated to 1.22, and dependencies are refreshed. My main feedback concerns a potential breaking change in the naming of release artifacts due to the new name_template in the archives section. I've suggested a modification to maintain backward compatibility for consumers of these artifacts.

Comment thread .goreleaser.yaml Outdated
Comment on lines +19 to +20
name_template: >-
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The new name_template changes the naming convention for release archives. The previous configuration produced names like ..._Darwin_x86_64, while the new template will produce ..._darwin_amd64. This could be a breaking change for users who rely on the old naming scheme.

To maintain backward compatibility with the previous archive names, you can use GoReleaser's template functions and variables. Specifically, {{ .Os | title }} will capitalize the OS name, and {{ .Amd64 }} will replace amd64 with x86_64.

Consider updating the name_template to preserve the existing naming convention.

    name_template: >-
      {{ .ProjectName }}_{{ .Version }}_{{ .Os | title }}_{{ .Amd64 }}

@renecannao
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

Warning

Rate limit exceeded

@renecannao has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 53 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d0c3511b-c46c-4a08-a8a0-30e2bbe6c8f2

📥 Commits

Reviewing files that changed from the base of the PR and between 5219d4a and 4566fd2.

📒 Files selected for processing (1)
  • .goreleaser.yaml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch phase1/task4-goreleaser

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@renecannao renecannao force-pushed the phase1/task4-goreleaser branch from b4b9849 to 4566fd2 Compare March 23, 2026 20:17
@renecannao renecannao merged commit 35df06d into master Mar 23, 2026
1 of 5 checks passed
@renecannao renecannao deleted the phase1/task4-goreleaser branch March 23, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix GoReleaser configuration for v2 syntax

2 participants